import axios from "axios";
const DOMAIN = "http://127.0.0.1:8888";

// const unAuthMap = new Map([["/user/login", "post"]]);

const AxiosRequest = axios.create({
  baseURL: DOMAIN,
  timeout: 60000, // 超时时间
});

// 设置请求拦截器
AxiosRequest.interceptors.request.use(
  (config) => {
    return config;
  },
  (error) => {
    return Promise.reject(error);
  }
);

// 设置响应拦截器
AxiosRequest.interceptors.response.use(
  (res) => {
    return res;
  },
  (error) => {
    return Promise.reject(error);
  }
);

export { AxiosRequest, DOMAIN };
